package org.vs.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.vs.domain.dto.PublishDTO;
import org.vs.domain.dto.VoteDTO;
import org.vs.domain.dto.VoteInfoDTO;
import org.vs.domain.model.TVote;
import org.vs.result.RestResult;

/**
 * @author Fall
 * @description 针对表【t_vote】的数据库操作Service
 * @createDate 2024-01-25 22:54:55
 */
public interface TVoteService extends IService<TVote> {
    /**
     * 加载所有的 投票
     *
     * @param page
     * @param pageSize
     * @param title
     * @param authorization
     * @return
     */
    RestResult all(Integer page, Integer pageSize, String title, String authorization);

    /**
     * 加载特定投票信息
     *
     * @param id
     * @param authorization
     * @return
     */
    RestResult info(Long id, String authorization);

    /**
     * 保存投票
     *
     * @param voteInfoDTO
     * @param authorization
     * @return
     */
    RestResult save(VoteInfoDTO voteInfoDTO, String authorization);

    /**
     * 删除投票
     *
     * @param id
     * @return
     */
    RestResult delete(Long id);

    /**
     * 发布投票
     *
     * @param publishDTO
     * @param authorization
     * @return
     */
    RestResult publish(PublishDTO publishDTO, String authorization) throws Exception;

    /**
     * 投票接口
     * @param voteDTO
     * @param authorization
     * @return
     */
    RestResult vote(VoteDTO voteDTO, String authorization) throws Exception;

    /**
     * 返回投票数据
     * @param id
     * @param authorization
     * @return
     */
    RestResult result(Long id, String authorization) throws Exception;

    /**
     * 返回 hash 数据
     * @param authorization
     * @return
     */
    RestResult hashMessage(String authorization);
}
